package cn.wolfcode.rbac.mapper;

import cn.wolfcode.rbac.domain.Employee;
import cn.wolfcode.rbac.query.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper {
    int deleteByPrimaryKey(Long id);
    int insert(Employee record);
    Employee selectByPrimaryKey(Long id);
    List<Employee> selectAll();
    int updateByPrimaryKey(Employee record);
    Employee selectByUsernameAndPassword(@Param("username") String username, @Param("password") String password);

    int selectForCount(QueryObject qo);
    List<Employee> selectForList(QueryObject qo);

    // 编辑时,先删除关系再处理中间表
    void deleteRelation(Long id);

    // 保存到中间表（员工id，角色id）,并添加注解
    void insertRelation(@Param("eid") Long eid, @Param("rid") Long rid);

    void batchDelete(Long[] ids);

    Employee selectByUsername(String username);

    List<Employee> selectByRoleSn(String... sns);
}